package com.jt.www.enums.woxuebao;

/**
 * @author admin_ltf
 * @create 2019-06-02 9:13
 */

public enum ProjectInfoEnum {

    JNXP("19PR979745", "XM0420190012", "济宁学平险(我学保线下)"),
    YNXP("19PR896371", "XM0420190013", "云南学平险(我学保线下)"),
    NONE("", "", "");
    private String productCode;
    private String projectCode;
    private String projectName;

    ProjectInfoEnum(String productCode, String projectCode, String projectName) {
        this.productCode = productCode;
        this.projectCode = projectCode;
        this.projectName = projectName;
    }


    /**
     * 通过产品编码得到项目相关信息
     *
     * @param productCode
     * @return
     */
    public static ProjectInfoEnum getProjectInfo(String productCode) {
        for (ProjectInfoEnum projectInfoEnum : ProjectInfoEnum.values()) {
            if (projectInfoEnum.productCode.equals(productCode)) {
                return projectInfoEnum;
            }
        }
        return NONE;
    }

    public String getProductCode() {
        return productCode;
    }

    public String getProjectCode() {
        return projectCode;
    }

    public String getProjectName() {
        return projectName;
    }
}
